/* 现代化全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a90e2;
    --primary-dark: #357abd;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.main-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-wrapper {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* 现代化导航栏样式 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 70px;
}

.nav-brand {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary-color), #667eea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: var(--transition);
}

.nav-brand:hover {
    transform: scale(1.05);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--primary-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-toggle:hover {
    background-color: rgba(74, 144, 226, 0.1);
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 8px;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    color: #666;
    text-decoration: none;
    padding: 12px 20px;
    display: block;
    border-radius: 25px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.nav-menu a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), #667eea);
    transition: var(--transition);
    z-index: -1;
}

.nav-menu a:hover::before,
.nav-menu a.active::before {
    left: 0;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.3);
}

/* 响应式导航 */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        transform: translateY(-20px);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
        gap: 0;
    }
    
    .nav-menu.show {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-menu li {
        margin: 8px 0;
    }
    
    .nav-menu a {
        padding: 15px 20px;
        border-radius: var(--border-radius);
        text-align: center;
    }
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    min-height: calc(100vh - 140px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 现代化卡片样式 */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.card-header {
    padding: 20px 30px;
    background: linear-gradient(135deg, var(--primary-color), #667eea);
    color: white;
    border-bottom: none;
}

.card-body {
    padding: 30px;
}

.card-footer {
    padding: 20px 30px;
    background-color: rgba(248, 249, 250, 0.8);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 25px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

/* 标题样式 */
h1 {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

h2 {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
}

h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
}

/* 现代化表单样式 */
.form-section {
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    transform: translateY(-2px);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
}

.required {
    color: var(--danger-color);
    font-weight: 700;
}

.form-help {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.form-error {
    color: var(--danger-color);
    font-size: 12px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.form-error::before {
    content: '⚠';
}

/* 表单网格布局 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.form-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.form-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* 现代化按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    border-radius: 25px;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    min-width: 120px;
    gap: 8px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition);
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #667eea);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
    text-decoration: none;
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), #868e96);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
    text-decoration: none;
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #34ce57);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
    text-decoration: none;
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #ffcd39);
    color: #212529;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.4);
    text-decoration: none;
    color: #212529;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #e55353);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
    text-decoration: none;
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    min-width: 80px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
    min-width: 160px;
}

.btn:disabled,
.btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 兼容旧样式 */
.btn-edit {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    margin-right: 8px;
}

.btn-delete {
    background: linear-gradient(135deg, var(--danger-color), #c0392b);
    color: white;
}

.action-buttons {
    margin-bottom: 20px;
}

.form-actions {
    margin-top: 20px;
}

.form-actions button {
    margin-right: 10px;
}

/* 现代化表格样式 */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.data-table th,
.data-table td {
    padding: 18px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.data-table th {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(102, 126, 234, 0.1));
    font-weight: 700;
    color: var(--primary-color);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.05), rgba(102, 126, 234, 0.05));
    transform: scale(1.01);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* 表格操作按钮 */
.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.table-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
    min-width: auto;
}

/* 表格状态 */
.table-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.status-active {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(52, 206, 87, 0.1));
    color: var(--success-color);
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.status-inactive {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(229, 83, 83, 0.1));
    color: var(--danger-color);
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.status-pending {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 205, 57, 0.1));
    color: var(--warning-color);
    border: 1px solid rgba(255, 193, 7, 0.2);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state-icon {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.empty-state-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

/* 筛选器样式 */
.filter-container {
    margin-bottom: 20px;
}

.filter-container .form-group {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 0;
}

.filter-container .form-group label {
    display: inline-block;
    margin-right: 10px;
}

.filter-container .form-group select {
    width: auto;
    display: inline-block;
}

/* 名片生成器样式 */
.card-generator {
    display: flex;
    gap: 30px;
}

.form-section,
.preview-section {
    flex: 1;
}

.card-preview {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background-color: #f9f9f9;
}

.company-info {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.company-logo {
    width: 120px;
    height: 120px;
    background-color: #4a90e2;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    margin-right: 20px;
    border-radius: 4px;
}

.company-details h3 {
    margin-bottom: 5px;
}

.personal-info p {
    margin-bottom: 10px;
}

.no-preview {
    text-align: center;
    color: #999;
    padding: 40px;
    border: 1px dashed #ddd;
    border-radius: 8px;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.close-btn:hover {
    color: #333;
}

.hidden {
    display: none;
}

/* 图片预览样式 */
#imagePreviewContainer {
    margin-top: 20px;
    text-align: center;
}

#imagePreview {
    max-width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.download-btn {
    margin-top: 10px;
    display: inline-block;
}

/* ========== 现代化通知系统样式 ========== */

/* 通知容器 */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    pointer-events: none;
}

/* 通知项 */
.notification {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 15px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
}

.notification.success::before {
    background: var(--success-color);
}

.notification.error::before {
    background: var(--danger-color);
}

.notification.warning::before {
    background: var(--warning-color);
}

.notification.info::before {
    background: var(--info-color);
}

/* 通知图标 */
.notification-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.notification.success .notification-icon {
    background: var(--success-color);
}

.notification.error .notification-icon {
    background: var(--danger-color);
}

.notification.warning .notification-icon {
    background: var(--warning-color);
}

.notification.info .notification-icon {
    background: var(--info-color);
}

/* 通知内容 */
.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

.notification-message {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* 关闭按钮 */
.notification-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    flex-shrink: 0;
}

.notification-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* 进度条 */
.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: rgba(0, 0, 0, 0.1);
    width: 100%;
}

.notification-progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 100%;
    transform-origin: left;
    animation: notificationProgress linear;
}

.notification.success .notification-progress-bar {
    background: var(--success-color);
}

.notification.error .notification-progress-bar {
    background: var(--danger-color);
}

.notification.warning .notification-progress-bar {
    background: var(--warning-color);
}

.notification.info .notification-progress-bar {
    background: var(--info-color);
}

@keyframes notificationProgress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* ========== 加载遮罩样式 ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(74, 144, 226, 0.2);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .table-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .table-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .notification-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }
    
    .notification {
        transform: translateY(-100px);
        padding: 15px;
    }
    
    .notification.show {
        transform: translateY(0);
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    .content-wrapper {
        padding: 15px;
    }
}